//
//  PCMeAlbumCell.m
//  PhotoCircle
//
//  Created by GL on 15/12/13.
//  Copyright © 2015年 wujungao. All rights reserved.
//

#import "PCMeAlbumCell.h"
#import "UIImageView+WebCache.h"
#import "PCPhotoModel.h"

#define FirstImageView 0
#define SecondImageView 1
#define ThirdImageView 2

@interface PCMeAlbumCell()

@property (weak, nonatomic) IBOutlet UILabel *dayLabel;
@property (weak, nonatomic) IBOutlet UILabel *monthLabel;

@property (weak, nonatomic) IBOutlet UIImageView *imageView_1;
@property (weak, nonatomic) IBOutlet UIImageView *imageView_2;
@property (weak, nonatomic) IBOutlet UIImageView *imageView_3;

@end

@implementation PCMeAlbumCell

- (void)awakeFromNib {
    // Initialization code
    
//    _imageView_1.tag = FirstImageView;
//    _imageView_2.tag = SecondImageView;
//    _imageView_3.tag = ThirdImageView;
    
//    UITapGestureRecognizer*tapGesture1 = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tapImageViewForFirst:)];
//    [_imageView_1 addGestureRecognizer:tapGesture1];
//    
//    UITapGestureRecognizer*tapGesture2 = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tapImageViewForSecond:)];
//    [_imageView_2 addGestureRecognizer:tapGesture2];
//    
//    UITapGestureRecognizer*tapGesture3 = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tapImageViewForThird:)];
//    [_imageView_3 addGestureRecognizer:tapGesture3];
}

-(void)configCellWithModel:(PCUserAlbumModel*)aModel
{
    _dayLabel.text = aModel.aDay;
    _monthLabel.text = aModel.aMonth;
    
    for (int i=0;i<[aModel.aPhotoArray count];i++) {
        PCPhotoModel *pModel = [aModel.aPhotoArray objectAtIndex:i];
        NSURL *imgUrl = [NSURL URLWithString:pModel.pImgUrl];
        if (i==0) {
            [_imageView_1 sd_setImageWithURL:imgUrl];
        }else if (i==1){
            [_imageView_2 sd_setImageWithURL:imgUrl];
        }else if (i==2){
            [_imageView_3 sd_setImageWithURL:imgUrl];
        }
    }
}

#pragma mark -
#pragma mark -UIImageView tapGesture
-(void)tapImageViewForFirst:(UITapGestureRecognizer*)tapImg
{
    NSLog(@"tapImageViewForFirst");
}

-(void)tapImageViewForSecond:(UITapGestureRecognizer*)tapImg
{
    NSLog(@"tapImageViewForSecond");
}

-(void)tapImageViewForThird:(UITapGestureRecognizer*)tapImg
{
    NSLog(@"tapImageViewForThird");
}

- (IBAction)moreButtonEvent:(UIButton *)sender {
    //moreButtonEvent
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
